package file;
/** 文件过滤器 Lambda 版*/
import java.io.File;

public class ListFileDemo3 {
    public static void main(String[] args) {
        File file = new File(".");
        if(file.isDirectory()){
            File[] files = file.listFiles(pathname -> pathname.getName().endsWith(".txt"));
            for (File f: files){
                System.out.println(f.getName());
            }
        }
    }
}
